/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CreateSpekxTicketModelFrame.java
 *
 * Created on 20/12/2011, 23:56:11
 */

package br.mg.bhe.ftpobre.gui;

import br.mg.bhe.ftpobre.SpekxTicket;
import javax.swing.DefaultComboBoxModel;

/**
 *
 * @author Aureliano
 */
public class CreateSpekxTicketModelFrame extends javax.swing.JDialog {

    /** Creates new form CreateSpekxTicketModelFrame */
    public CreateSpekxTicketModelFrame(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        DefaultComboBoxModel model = new DefaultComboBoxModel(SpekxTicket.values());
        model.insertElementAt("Selecione...", 0);
        this.comboBoxTicketType.setModel(model);
        this.comboBoxTicketType.setSelectedIndex(0);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        labelTicketType = new javax.swing.JLabel();
        comboBoxTicketType = new javax.swing.JComboBox();
        scrollPaneTicket = new javax.swing.JScrollPane();
        textAreaTicket = new javax.swing.JTextArea();
        buttonClose = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Modelo de Ticket Spekx");
        setResizable(false);

        labelTicketType.setText("Tipo de Script:");

        comboBoxTicketType.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                comboBoxTicketTypeItemStateChanged(evt);
            }
        });

        textAreaTicket.setColumns(20);
        textAreaTicket.setRows(5);
        scrollPaneTicket.setViewportView(textAreaTicket);

        buttonClose.setText("Fechar");
        buttonClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCloseActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(scrollPaneTicket, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(labelTicketType)
                        .addGap(18, 18, 18)
                        .addComponent(comboBoxTicketType, 0, 293, Short.MAX_VALUE))
                    .addComponent(buttonClose))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelTicketType)
                    .addComponent(comboBoxTicketType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(scrollPaneTicket, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(buttonClose)
                .addContainerGap())
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-408)/2, (screenSize.height-401)/2, 408, 401);
    }// </editor-fold>//GEN-END:initComponents

    private void buttonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCloseActionPerformed
        super.dispose();
    }//GEN-LAST:event_buttonCloseActionPerformed

    private void comboBoxTicketTypeItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comboBoxTicketTypeItemStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_comboBoxTicketTypeItemStateChanged

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonClose;
    private javax.swing.JComboBox comboBoxTicketType;
    private javax.swing.JLabel labelTicketType;
    private javax.swing.JScrollPane scrollPaneTicket;
    private javax.swing.JTextArea textAreaTicket;
    // End of variables declaration//GEN-END:variables

}